// JavaScript Document
function link_color() {
	var normalColor = $('a:link').css('color');
  	$('a:visited').css('color', normalColor);
}

function link_animation() {
	$('.drop').slideDown(2000);
}

$(document).ready(function() {
  
  link_color();
  link_animation();

  $('.deleteIdea').click(function(){
  
	var elem = $(this).closest('.item');

	$.confirm({
		'title'		: 'Delete Confirmation',
		'message'	: 'You are about to delete this item. <br />It cannot be restored at a later time! Continue?',
		'buttons'	: {
			'Yes'	: {
				'class'	: 'blue',
				'action': function(){
					$('#deleteform').ajaxSubmit();
					window.location.replace("http:www.ideascover.site90.net/mainpage");
				}
			},
			'No'	: {
				'class'	: 'gray',
				'action': function(){}	// Nothing to do in this case. You can as well omit the action property.
			}
		}
	});

  });
  
  $('.deleteMessage').click(function(){
    
  	var elem = $(this).closest('.item');
  
  	$.confirm({
  		'title'		: 'Delete Confirmation',
  		'message'	: 'You are about to delete this message. <br />It cannot be restored at a later time! Continue?',
  		'buttons'	: {
  			'Yes'	: {
  				'class'	: 'blue',
  				'action': function(){
  					$('#deleteform').ajaxSubmit();
  					location.reload();
  				}
  			},
  			'No'	: {
  				'class'	: 'gray',
  				'action': function(){}	// Nothing to do in this case. You can as well omit the action property.
  			}
  		}
  	});
  
  });

  $('#newidea').hover(
  function() {
	$('#newidea').stop().animate({ marginLeft: '260px' },'fast');
  },
  function() {
    $('#newidea').stop().animate({ marginLeft: '210px' },'fast');
  });
  
  $('#loginuser').hover(
  function() {
        $('#profilemenu').slideDown('fast');
      },
      function() {
        $('#profilemenu').stop().slideUp('fast');
  });
  
  $('.idealist, .idealistpremium').hover(
  function() {
      $(this).find('div').stop().animate({ marginTop: '-240px', display:'inline' },'fast');
    },
  function() {
      $(this).find('div').stop().animate({ marginTop: '0px' },'fast');
  });
  $('.idealist, .idealistpremium').hover(
      function() {
        $(this).find('div').slideDown('fast');
      },
      function() {
        $(this).find('div').stop().slideUp('fast');
  });
  
  $('.contentMain').hover(
      function() {
        $('.idealist, .idealistpremium').stop().animate({marginTop: '100px', display:'inline' },'fast');
        $('.idealisttitle').slideDown('fast');
      },
      function() {
  });
  
  
});